package com.itheima.mp.controller;

import java.util.*;

/**
 * @author wuJiaWei
 * @version 1.0
 */
public class DemoController {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("a", "b", "c");
        //传统foreach
        for (String s : list) {
            System.out.println(s);
        }
        //lambda表达式
        list.forEach((s) -> System.out.println(s));
        //方法引用
        list.forEach(System.out::println);

        //map
        HashMap<Integer, String> map = new HashMap<>();
        map.forEach((k,v) -> System.out.println(k + "=" + v));
    }
}
